System, method and a computer readable medium for providing an output image

ABSTRACT

A method for providing an output image, the method includes: determining an importance value for each input pixels out of multiple input pixels of an input image; applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.

This application claims the priority of U.S. provisional patent application Ser. No. 60/913,301 filing date Apr. 23, 2007

BACKGROUND OF THE INVENTION

With the recent advent of mobile video displays, and their expected proliferation, there is an acute need to display video on a smaller display than originally intended. Two main issues need to be confronted. The first is the need to change the aspect ratio of a video. The second is the need to down-sample the video whilst maintaining enough resolution of objects-of-interest. An example of the first challenge is the display of wide screen movies on a 4:3 TV screen. Displaying a ball game on a cellular screen is a good example for the need of a smart down-sampling technique, where the ball needs to remain large enough to be easily seen on screen.

The current industry solutions are basic and not very effective. They include: blunt aspect ratio free resizing; cropping the middle of the video; resizing while preserving the aspect ratio by adding black stripes above and below the frame; and keeping the middle of the frame untouched while warping the sides. In fact, it is common nowadays to have printed lines on movie-cameras' screens that mark the region that will be visible in the frame after it would be cropped to the aspect ratio of a regular 4:3 TV screen.

There is a growing need to provide effective devices and method for image transformation.

SUMMARY OF THE INVENTION

A method for providing an output image, the method includes: determining an importance value for each input pixels out of multiple input pixels of an input image; applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.

A device for providing an output image, the device includes: a memory unit adapted to store an input image and a processor, adapted to: determine an importance value for each input pixels out of multiple input pixels of an input image and apply on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.

A computer readable medium that stores instructions for: determining an importance value for each input pixels out of multiple input pixels of an input image; and applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.

A method for providing an output image, the method includes: receiving an input frame and a feature mask defined by a rough selection of the features; applying a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.

A device for providing an output image, the device includes: a memory unit adapted to store an input image and a feature mask defined by a rough selection of the features; a processor, adapted to: apply a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.

A computer readable medium that stores instructions for: receiving an input frame and a feature mask defined by a rough selection of the features; applying a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 a illustrates a system according to an embodiment of the invention;

FIG. 1 b illustrates a system according to another embodiment of the invention;

FIG. 2 illustrates a flow chart of a method according to an embodiment of the invention;

FIG. 3 illustrates a flow chart of a method according to another embodiment of the invention;

FIG. 4 illustrates a flow chart of a method according to an embodiment of the invention;

FIG. 5 illustrates a flow chart of a method according to an embodiment of the invention;

FIGS. 6 a-6 b, 7 a-7 h, 8 a-8 c, 9 a-9 d, 10 a-10 f, 11 a-11 j are input and output images;

FIGS. 12 a-12 c, 13 a-13 b, 14 a-14 d, 15 a-15 e, 16 a-16 c, 17 a-17 c, 18 a-18 d, 19 a-19 b are input and output images; and

FIG. 12 d includes a series of images that illustrate various stages of a method according to an embodiment of the invention.

DETAILED DESCRIPTION OF THE DRAWINGS

The terms “frame” and “image” have the same meaning. Each means a set or group of pixels. Multiple frames or images can form a shot, one or more shots can form a video stream.

Video retargeting is the process of transforming an existing video to fit the dimensions of an arbitrary display. A compelling retargeting aims at preserving the viewers' experience by maintaining the information content of important regions in the frame, whilst keeping their aspect ratio.

An efficient method for video retargeting is introduced. It includes two stages. First, the frame (input image) is analyzed to detect the importance of each region (or multiple input pixels) in the frame. Then, a transformation (conversion process) that respects the analysis shrinks less important regions more than important ones. The analysis is fully automatic and based on local saliency, motion detection, and object detectors. The performance of the proposed method is demonstrated on a variety of video sequences, and compared to the state of the art in image retargeting.

A method is provided. The method assigns a saliency score to each pixel in the video. An optimized transformation of the video to a downsized version is then calculated that respects the saliency score. The method is designed to work efficiently in an online manner, ultimately leading to a real-time retargeting of a streaming input video to several output formats. The saliency score is composed of three basic components: spatial gradient magnitude, a face detector (or another object of interest detector), and a block-based motion detector. The optimization stage amounts to solving a sparse linear system of equations. It considers spatial constraints as well as temporal ones, leading to a smooth temporal user experience. It is noted that the method can be applied in off-line, with the advantage of analyzing the entire shot.

Conveniently, a computer readable medium is provided. The computer readable medium can be a diskette, a compact disk, a disk, a tape, a memory chip and the like and it stores instructions for: determining an importance value for each input pixels out of multiple input pixels of an input image; and applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image. The computer readable medium can store instructions for executing any stage of method 100.

Given a new frame, the method computes a per-pixel importance measure. This measure is a combination of three factors: a simple, gradient based, local saliency; an off-the-shelf face detector; and a high-end motion detector.

The optimization of the mapping function from the source resolution to the target resolution is set through a linear system of equations. Each pixel (i,j) at each frame t is associated with two variable x_(i,j,t), y_(i,j,t) that determine its location on the retargeted frame. The method optimizes for horizontal warps and for vertical warps separately, using the same technique. The horizontal post-warp location is first constrained to have the same coordinates as the warp of the pixel just below it x_(i,j+1,t), and the pixel just before it x_(i,j,t−1). Then it is constrained to have a distance of one from the warping of its left neighbor x_(i−1,j,t).

For obvious reasons, it is impossible to satisfy all of the constraints and yet fit into smaller retargeting dimensions. To these space-preserving constraints, a weight was added in proportion to the pixel's importance value. A pixel with high importance is mapped to a distance of approximately one from its left neighbor, while a pixel of less saliency is mapped closer to its neighbor. Time smoothness is also taken into consideration, in order to generate a continuous natural-looking video.

The method is designed for video streaming. Therefore, time smoothness and motion analysis considerations are limited to the previous frames only. Such considerations need only apply to frames of the same shot (a sequence of video frames taken from a continuous viewpoint). It is noted that the method can be applied in off-line and thus can take into account multiple images of an input image sequence. It is noted that the method can be extended to an off-line method; thus, it can incorporate the advantages of off-line video analysis. This includes smooth time analysis that computes the mapping of each frame (image) based on an arbitrary number of frames before or after it, and better, more accurate motion-detector, shot-detector and object-detectors that can incorporate information from several frames at once.

The proposed method automatically breaks a long video into a sequence of shots using a simple online method, similar to the one shown in Meng, Y. Juan, and S.-F. Chang. Scene change detection in an MPEG-compressed video sequence; Digital Video Compression: Algorithms and Technologies, 1995 where the block matching operation is replaced with the efficient method of Lu and M. Liou. A simple and efficient search algorithm for block-matching motion estimation. IEEE Trans. Circuits and Systems, 1997. This combination is efficient, robust, and uninfluenced by object and camera motion. First, motion estimation is applied on each macro-block (16×16 pixels). A shot boundary is detected wherever the number of blocks for which the motion estimation fails exceeds a threshold. It is noted that the proposed method can be replaced with other “Shot detection” mechanisms, including off-line shot detection mechanisms.

Importance Determination

A content preservation weight matrix is defined:

$\begin{matrix} {S = {\min\left( {{S_{E} + {\sum\limits_{i}\; S_{F}^{i}} + S_{MD}},1} \right)}} & (1) \end{matrix}$

Each entry in the matrix represents the saliency of a single pixel in the source frame I. Values range between 0 and 1, where zero values are, content wise, non-important pixels. It is noted that other saliency factors can be added into this formula, for example, the output of more object detectors, or output of background regions. These factors need not only be combined using a linear function but also can be implemented using a more complex function such in the case of a probability computation.

Local Saliency

Various local saliency algorithms can be applied. For example, a simple measure for local information content in the frame such as the L₂-Norm of the gradient is applied:

$S_{E} = {\left( {\left( {\frac{\partial}{\partial x}I} \right)^{2} + \left( {\frac{\partial}{\partial y}I} \right)^{2}} \right)^{1/2}.}$

It is noted that the local saliency function can be replaced with other energy function such as L₁-Norm or with the output of local saliency detectors.

Face Detection

According to an embodiment of the invention, the local saliency algorithm is based upon wavelet transformation. The wavelet breaks the frame into its “wavelets”, scaled and shifted versions of a “mother wavelet.” These scaled and shifted versions can be calculated by applying high pass filters and low pass filters. These scaled and shifted versions of the frame are associated with levels. Higher levels are referred to as coarser levels and include fewer details. Each level can include few (such as three) diagonal high frequency frame version (generated by applying a high pass filter on a previous level frame version in few directions such as, corollary horizontal, vertical and diagonal) and a low frequency frame version (generated by applying a low pass filter on a previous level frame version).

Conveniently, the local saliency algorithm includes: (i) wavelet decomposing a frame into multiple (N) levels; (ii) locating the coarsest diagonal high frequency frame in which the percentage of wavelet coefficients having values below a first threshold is below a second threshold; (iii) thresholding the coarsest diagonal high frequency frame (using the first threshold) to provide a binary frame (in which a bit can be set if the corresponding wavelet coefficient is above the threshold and can be reset of the corresponding wavelet coefficient is below the threshold); (iv) re-sizing the binary frame to the size of the input image; (v) smoothing the re-sized binary frame (for example by applying a Gaussian blur filter) to provide a saliency score per pixel of the input frame. It is noted that the high frequency diagonal frames can be HH frames (generated by a both horizontal and verticla high pass filters), that the locating stage can start from the N'th level and propagate upwards (to less coarse frames) till reaching the first diagonal high frequency frame that in which less then 50% of the wavelet coefficients have a value that is below the first threshold.

Human perception is highly sensitive to perspective changes in faces, more specifically to frontal portraits. In order to avoid deforming frontal portraits the Viola and Jones face detection mechanism was applied. (P. Viola and M. Jones. Robust real-time face detection. International Journal Computer Vision, 2004.)

The detector returns a list of detected faces. Each detected face i has a 2D center coordinate F_(p) ^(i) and a radius F_(r) ^(i). The face detection score of each pixel is a function of the distance of that pixel from the face's center: D_(i)(x, y)=PF_(p) ^(i)−(x, y)P₂, and is given by the cubic function:

$\begin{matrix} {{{\hat{S}}_{F}\left( {x,y} \right)} = {\max\left( {{1 - \frac{{- {D_{i}\left( {x,y} \right)}^{3}} + {{.5}*{D_{i}\left( {x,y} \right)}^{2}}}{{- \left( F_{r}^{i} \right)^{3}} + {{.5}*\left( F_{r}^{i} \right)^{2}}}},0} \right)}} & (2) \end{matrix}$

This function, which ranges between 0 and 1, is used to weight the importance of the face as an almost constant function with a drastic fall near the end of the face. This allows some flexibility at the edges of the face whilst avoiding face deformation. It is noted that the above function can be replaced with other weight function such as linear or square functions.

A rescaling measure can be provided. It has the following format:

$\begin{matrix} {{F_{rn}^{i} = \frac{F_{r}^{i}}{\max \left( {C_{Width},C_{Height}} \right)}}{{S_{F}^{i}\left( {x,y} \right)} = {{{\hat{S}}_{F}^{i}\left( {x,y} \right)}\left( {1 - {2.5*\left( F_{rn}^{i} \right)^{4}} - {1.5*\left( F_{rn}^{i} \right)^{2}}} \right)}}} & (3) \end{matrix}$

used to rescale the general saliency of a detected face in relation to the area it occupies in a C_(Width)×C_(Height) pixels frame. A 1 factor is used where the size of the face is relatively small, while extremely large faces tend to be ignored. The above prevents a distorted zooming effect, i.e. retargeting of the frame such that it is mostly occupied by the detected face. It is noted that the above rescaling function can be replaced with other rescaling function such as a constant function, linear and the like.

Since, as stated below, when shrinking the width of an image, smoothness over the columns is required, a detected face (detected by a face detector) also prevents thinning the regions below it. Therefore, human bodies are shrunk less, as necessitated. It is noted that a specific human figure detector can be added/replace the above face detector.

Retargeting examples of a frame (a) from the movie “300” with and without face detection. (b) the gradient map, with the faces detected imposed. (c) the result of retargeting to half the width without face detection. (d) the result of retargeting with face detection. The result of the whole shot compared to bi-cubic interpolation is available in the supplemental material.

Motion Detection

Moving objects in video draw most of the viewers' attention and are content-wise important. By using motion detection mechanism video can be retargeted while preserving the temporal context.

The second motion detector suggested in S.-C. Liu, C.-W. Fu, and S. Chang. Statistical change detection with moments under time-varying illumination. IEEE Trans. on Image Processing, 1998 is implemented. The selected method is efficient and effective, although little known.

Let the frame be partitioned into N×N (N=8) pixel square blocks and A_(uv) denote the (u, v)th block. The image coordinate (x, y) is in A_(uv) if (u−1)N+1≦x≦uN and (v−1)N+1≦y≦vN. define x′=(x)_(mod N) and y′=(y)_(mod N).

For each block A_(uv), the total intensity of the block at frame t is calculated: A_(t)(u, v):=Σ_(x′=1) ^(N)Σ_(y′=1) ^(N)I_(t)(x, y). Then, the normalized “circular shift moments” in the x and y directions mx_(t) ^(j)(u, v), my_(t) ^(j)(u, v) are computed for j=0 . . . N−1. The x moment is formulated: (respectively y)

$\begin{matrix} {{{mx}_{t}^{j}\left( {u,v} \right)} = {{A_{t}\left( {u,v} \right)}^{- 1}{\sum\limits_{x^{\prime} = 1}^{N}\; {\left( {x - j} \right)_{{mod}\mspace{11mu} N} \cdot {\sum\limits_{y^{\prime} = 1}^{N}\; {I_{t}\left( {x,y} \right)}}}}}} & (4) \end{matrix}$

A motion in block (u, v) is detected if the maximum absolute difference in any of the computed moments between two consecutive frames is larger than a threshold. i.e., no motion is detected if for all j, |mx_(t) ^(j)(u, v)−mx_(t+1) ^(j)(u, v)|<χ and |my_(t) ^(j)(u, v)−my_(t+1) ^(j)(u, v)|<χ. In some tests χ=0.3.

The motion-based saliency S_(MD)(x, y) is set to one if the block A_((└x/N┘)(└y/N┘)) has motion, and zero otherwise. It is noted that the above motion detector can be replaced by other block-based/pixel-based motion detectors, such as the simple “Mean Absolute Difference” block based motion detector.

According to another embodiment of the invention the motion based saliency of a pixel can be responsive to the amount of motion. Accordingly, the motion based saliency can have weights that range between (for example) zero and 1. Higher motion values will result in lower motion based saliency values. This can include: (i) Using the motion based saliency, to construct a new time weighting matrix, thus achieving more “flexible” solution in high motion areas; (ii) building a weighting matrix that reflects a difference between “1” and the values of a motion based saliency matrix; (iii) utilizing this matrix when solving various constraints.

As can be seen in FIG. 5′ the moving objects gain saliency, thus seizing a larger area in the retargeted video.

Optimization

It is suggested to apply a conversion process that is responsive to an importance of an input pixel. It includes finding an optimal mapping between the source image (input image) and the retargeted image (output image) and especially solving a sparse linear system of equations, conveniently, by applying a least squares manner solution. A more natural formalization is to cast the problem as a constrained linear system. This way one can guarantee that no pixel falls out of bounds and that the mapping preserves the order of the pixels along the scan lines in the image. However, the solution to the unconstrained system is more efficient, and, in practice, the mappings recovered using the unconstrained systems of equations do not contain noticeable artifacts due to changes in the order of the pixels. It is noted that the “least square” measure used to minimize the cost function can be replaced by any error measuring function, such as the L₁-Norm.

In the retargeting process a pixel (i,j) in frame t of the video is being mapped into a pixel in frame t of the output video with some computed location (x_(i,j,t), y_(i,j,t)). Hence, there is twice the number of variables (x_(i,j,t) and y_(i,j,t)) to solve for then the number of pixels in the input video. A computation of the y variables can be made separately from the computation of the x variables, using the same linear method (described below). The mapping computation is done one frame at a time (see below), and so the system of equations has (approximately) the same number of unknowns as the number of pixels in one input frame.

Consider the problem of recovering the new x-axis locations x_(i,j,t) of pixels (i,j), i=1 . . . C_(Width), j=i . . . C_(Height), in frames t=1 . . . C_(Duration). The problem of determining y_(i,j,t) is the transpose of this problem and is solved in a similar manner. Also, consider first the more applicable problem, in which frame should also be shrieked, i.e., to map the frame to a narrower frame with width C_(TargetWidth)<C_(Width). The expanding problem is similar, though its goal is more application dependent.

There are four types of constraints. First, each pixel to be at a fixed distance from its left and right neighbors. Second, each pixel needs to be mapped to a location similar to the one of its upper and lower neighbors. Third, the mapping of a pixel at time t (current input image) needs to be similar to the mapping of the same pixel at time t+1 (previous input image). The forth constraint fits the warped locations to the dimensions of the target video frames.

Importance Modeling.

If a pixel is not “important” it can be mapped close to its left and right neighbors consequently blending with them. An “important” pixel, however, needs to be mapped far from its neighbors, thus a region of important pixels is best mapped into a region of a similar size. These insights are formulated into equations stating that every pixel should be mapped at a horizontal distance of 1 from its left and right neighbors. These equations are weighted such that equations associated with pixels with higher importance-score are more influential on the final solution. The first type of equations is therefore:

S _(i,j,t)(x _(i,j,t) −x _(i−1,j,t))=S _(i,j,t)  (5)

S _(i,j,t)(x _(i+1,j,t) −x _(i,j,t))=S _(i,j,t),

More precisely, since the at least-squares manner solution is applied then an equation arising from a pixel of importance S_(i,j,t) is as influential as

$\frac{S_{i,j,t}^{2}}{S_{i^{\prime},j^{\prime},t^{\prime}}^{2}}$

equations arising from a pixel of importance S_(i′,j′,t′).

It is noted that S is the saliency matrix of Eq. (1), except the time index appears explicitly. Note that the equation looking right from pixel (i−1, j) can be combined with the equation looking left from pixel (i, j) to one equation:

(S _(i−1,j,t) +S _(i,j,t))(x _(i,j,t) −x _(i−1,j,t))=(S _(i−1,j,t) +S _(i,j,t))  (6)

Boundary Substitutions.

In order to make the retargeted image fit in the new dimensions a constraint is added that defining the first pixel in each row of the frame (1, j, t) to be mapped to the first row in the retargeted video, i.e., ∇j, ∇t x_(1,j,t)=1. Similarly, the last pixel of each row is mapped to the boundary of the remapped frame: ∇j, ∇t x_(C) _(Width) _(,j,t)=C_(TargetWidth).

Since the mappings of the first and last pixels in each row are known, there is no need to have unknowns for them. Instead, it is substituted with the actual values whenever x_(1,j,t) or x_(C) _(Width) _(,j,t) appear in Eq. (6).

Spatial and Time Smoothness

It is important to have each column of pixels in the input image mapped within the boundaries of a narrow strip in the retargeted image. Otherwise, the image looks jagged and distorted. These type of constraint are weighted uniformly, and take the form:

W ^(s)(x _(i,j,t) −x _(i,j+1,t))=0  (7)

In the system W^(s)=1. In order to prevent drifting, a similar constraint is added that states that the first and the last pixels of each column have a similar displacement.

W ^(s)(x _(i,1,t) −x _(i,C) _(Height) _(,t))=0  (8)

The mapping also has to be continuous between adjacent frames, as stated bellow:

W _(i,j,t) ^(t)(x _(i,j,t) −x _(i,j,t−1))=0,  (9)

where, in order to prevent distortion of faces, the weighting depends on the face detector saliency map W^(t)=0.2(1+S_(F)). Note that according to an embodiment of the invention in on line more (real time mode) the resources do not necessarily allow to build a system of equations for the whole shot. Instead mapping is computed for each frame given the previous frame's computed mapping. This limited-horizon online time-smoothing method and, as illustrated in FIG. 6′ can improve results significantly.

Altering the Aspect Ratio of the Input Image

Examples of aspect ratio altering are exhibited in FIG. 7′ and in other figures throughout this manuscript.

The format of the retargeted videos is as follows: each frame is divided into three sub frames. The bottom one is the original video frame. The top right sub-frame is the result of applying bi-cubic interpolation to obtain a new frame of half the input width. The top-left sub-frame is the retargeted result.

While the method does not explicitly crop frames, whenever the unimportant regions in the frame lie away from the frame's center, an implicit cropping is created. See, for example, the retargeting result of the sequence Akiyo (FIGS. 1′a-1′c). Many pixels at the left and right sides of the input frames are mapped into the first and last few columns of the retargeted frames, hence disappearing. FIG. 1 a illustrates an original frame from the standard benchmark news sequence “Akiyo”, FIG. 1 b illustrates a half width retargeted frame achieved by applying method 100 and FIG. 1 c illustrates a half width retargeted frame achieved with a prior art transformation.

Down-Sizing Results

The down-sampling results (preserving the aspect ratio) are exhibited in FIG. 8′.

The x-axis and the y-axis warps were computed independently on the original frame and then applied together to produce the output frames. As can be seen, there is a strong zooming-in effect in our results, as necessitated by the need to display large enough objects on a small screen.

It is noted that by using a global error measuring function (such as least squares) the solution tends to uniformly distribute the error across the whole image, rather than concentrate it locally.

Video Expanding

The method can also be used for video expanding. In such a case, however, the desired output depends on the application. In one application, for stills, the task is to keep the original size of the salient objects, while enlarging the video by filling-in the less salient locations with unnoticeable pixels. For such a task, the method can work without any modifications.

In another application, one would like the salient objects to become larger without creating noticeable distortions to the video. A related task is foreground emphasis through non-homogenous warping in-place, where the dimensions of the video remain the same (salient objects are increased in size on the expense of less salient regions). To apply the method in these cases, we need to alter Equation (6) to have the preferred inflating ratio on the right-hand-side. If given by the user or by some heuristic, this is a simple modification. For an inflation by a fixed factor of two where the width is increased and the height remains the same.

According to another embodiment of the invention the device and method are adapted to compensate for camera motion, camera zoom-out and camera zoom-in. Accordingly, the method can compensate for (or substantially ignore) motion introduced by camera manipulation and not by an actual movement of the object. This stage can involve incorporating global affine motion registration, into the solution of the optimization problem. In such a case the global motion is compensated before the optimization stage, and added/subtracted from the optimization solution.

According to another embodiment of the invention the method and device can be used to convert an input video stream to a shorter output video stream. This can be applied by computing an optimal per-pixel time warping via a linear system of equations. Each pixel will be mapped to a time-location in the output video that is similar to that of its spatial neighbors. Important pixels are to be mapped to locations in time distinct from their time-line neighbors. Each frame in the output video is assembled using several input frames, such that moving objects do not overlap.

Data Reduction

According to an embodiment of the invention the conversion process can be simplified, and additionally or alternatively, applied on multiple frames at once, by reducing the amount of information that is processed during the conversion process. For example, after the importance of each pixel of a frame is calculated, a smaller information set can be used when calculating the conversion process. The smaller information set can include multiple variables, each representative of an importance of multiple pixels, it can include only importance information of a sub set of the pixels, and the like. The data reduction can be implemented by various mathematical manners such as but not limited to averaging, quantizing, sub-set selection and the like.

For example, assuming that an input saliency matrix (which includes information about all pixels of the frame) has G elements, then a reduced matrix can include fewer elements (for example G/R). After the smaller matrix is used during the conversion process the results are up-scaled, for example by using a bilinear filter, a Bi-cubic filter, and the like.

Group of Frame Processing

According to an embodiment of the invention the conversion process can be applied on a group of frames. This group can form a shot or a portion of the shot. When the conversion process is applied on frames of a sequence of consecutive frames then the time smoothness can be further improved as a frame is processed not just in relation to a previous frame but also in relation to one or more following frames.

Conveniently, a single conversion process can be applied on a group of frames after performing data reduction on each frame, but this is not necessarily so and depends upon the number of frames, the computational resources and memory resources that can be used during the conversion process and timing requirements as it can be harder to provide real time processing or even almost real time processing on a group of frames.

For example, assuming that the group of images form a shot the processing can include: (i) calculating the saliency of every frame in the shot; resize each saliency matrix (Width×Height) to a reduced matrix (Width×{Height/ReductionFactor}) using bilinear/bicubic interpolation, (ii) generate a combined saliency matric that includes the different reduced matrices)—for example by concatenate the different reduced saliency matrices one after the other to provide, wherein the size of the combined saliency matric has the following dimensions: Width×(Height*NumberOfMatrices/Reduction Factor); (iii) calculating the optimization matrix with various constraints, such as: (iii.a) X(i,j,t)−X(i,j+1,t)=1; (iii.b) X(i,j,t)−X(i+1,j,t)=0; (iii.c) X(i,j,t)−X(i,j,t+1)=0; (iii.d) X(i,1,1)=1; (iii.e) X(i,Width,NumberOfFrames)=TargetWidth; (iv) adding weights; (v) solving the linear system; and (vi) mapping each frame using the upscale solution.

Panning

Panning includes emulating a movement of a camera, such as a horizontal movement or rotation. Panning can be introduced when the conversion process is applied on a group of frames. In this case the panning can be represented by selecting portions of a larger frame, wherein the selection of portions provides a panning effect. In this case the conversion process can include mapping pixels of an input frame (that its location within the larger frame changes over time) to an output frame.

Conveniently, these mentioned above varying boundaries are includes in the set of constraints that are solved by the conversion process.

For example, assume that the variable Pan_t is the horizontal panning of frame t. It differs over time to provide the panning effect. Then the conversion process should take into account the following constraints: (ia) X(i,1,t)−Pan_t=1; (ib) X(i,n,t)−Pan_t=new_width; (ic) X(i,j,t)+Pan_t−X(i,j,t+1)−Pan_t+1=0//times some weighting (I use 0.11); (ii) Pan_t−Pan_{t+1}=0; //times some weighting (I use 0.000001); and (iii) Pan_(—)1=0

Under these constraints the linear system is solved. For each frame a solution-matrix is provided and Pan_t can be subtracted from it. (iv) the solution matrix is upscaled to the original frame size. (v) The frame is remapped.

A device is provided. The device can include hardware, software and/or firmware.

FIG. 1 a illustrates device 200 according to an embodiment of the invention. Device 200 includes a processor 210 and memory unit 220. It can be connected to a display or a printer or can include at least one of these components. Memory unit 220 is adapted to store an input image and processor 210 is adapted to: determine an importance value for each input pixels out of multiple input pixels of an input image and apply on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image. Processor 210 can execute code that is stored in a computer readable medium.

Conveniently, processor 210 includes a local saliency detection module 212, face detection module 214, motion detection module 216 and mapping optimizing module 218. These modules cooperate in order to provide an output image. It is noted that processor 210 can work in an in-line manner, in a partially off-line manner or entirely in an off-line manner. It is further notes that various objects of interest can be detected by processor 210, in addition to or instead of faces. Each module can include software, hardware, firmware or a combination thereof.

Local saliency module 212 calculates local saliency values of pixels. Face detection module 214 detects faces. Motion detection module 216 detects motion. Mapping optimizing module 218 applies the conversion process.

Conveniently, processor 210 is adapted to perform at least one of the following or a combination thereof: (i) determine an importance of an input pixel in response to an importance input pixel mask. The mask can be defined by a user; (ii) determine an importance of an input pixel in response to motion associated with each of the multiple input pixels; (iii) determine an importance of an input pixel in response to a saliency score of the input pixels; (iv) determine an importance of an input pixel in response to an inclusion of an input pixel within an input image that represents a face of a person and/or within an object of interest. The object of interest is predefined and can depend upon the expected content of the image. For example, when viewing sport events the ball can be defined as an object of interest; (v) generate an output image such that a distance between output image representations of a pair of adjacent input pixels is responsive to an importance of at least one of pair of adjacent input pixels. Thus, for example, a pair of important input image pixels can be mapped to a pair of output image pixels while less important pair of input pixels can be mapped to the same pixel or be mapped to output pixels whereas the distance between their output image representations is less than a pixel; (vi) at least partially compensate for camera induced motion. This motion can result from zoom-in, zoom-out, camera rotation, and the like; (vii) apply an optimal mapping between the input image (original frame or source frame) to the output image (retargeted image); (viii) solve a set of sparse linear equations; (ix) apply a conversion process in response to at least one of the following constraints: each input pixel is mapped to an output pixel that is located at substantially a fixed distance from its left and right neighbors; each input pixel is mapped to an output pixel located to substantially a similar location to which upper and lower input pixels are mapped; an input pixel is mapped to an output pixel located substantially at a same location as an output pixel to which the same input pixel at a previous image was mapped; and size and shape of the output image; (x) perform re-sizing (down-sizing, up-sizing, warping, and the like); (xi) alter an aspect ratio.

The processor is adapted to perform at least one of the mentioned above operations by executing code. It is noted that the adaptation involve providing hardware circuitries that can assist in executing one or more of the mentioned above stages. The hardware can include memory circuitry, logic circuitry, filters, and the like.

Conveniently, the input image belongs to an input image sequence and processor 210 is adapted to apply a conversion process in response to a relationship between the input image and at least one other input of the input image sequence.

Processor 210 can execute at least one stage of methods 100 or 300 or a combination thereof. It can, for example, perform data reduction, wavelet decomposition, group of frames processing, and panning.

FIG. 1 b illustrates device 201 according to an embodiment of the invention. Device 201 differs from device 200 by including processor 211 that also include a data reduction module 219 and a wavelet decomposition module 217. It is noted that a processor can include only one of these modules. The data reduction and wavelet decomposition stage are further illustrated in FIGS. 2 and 3.

FIG. 2 illustrates method 100 according to an embodiment of the invention. Method 100 starts by stage 110 of determining an interest value for each input pixels out of multiple input pixels of an input image. Conveniently, stage 110 includes stage 111 of applying a wavelet decomposition in order to provide a local saliency of each pixel. Stage 111 is illustrated in FIG. 3. Stage 111 can include at least one of the following stages: (i) stage 111(1) of decomposing a frame into multiple (N) levels; (ii) stage 111(2) of locating the coarsest diagonal high frequency frame in which the percentage of wavelet coefficients having values below a first threshold is below a second threshold; (iii) stage 111(3) of thresholding the coarsest diagonal high frequency frame (using the first threshold) to provide a binary frame; (iv) stage 111(4) of re-sizing the binary frame to the size of the input image; (v) and stage 111(5) of smoothing the re-sized binary frame (for example by applying a Gaussian blur filter) to provide a saliency score per pixel of the input frame.

Stage 110 can include at least one of the following: (i) stage 112 of determining a importance input pixel mask, (ii) stage 113 of determining an importance of an input pixel in response to motion associated with each of the multiple input pixels; the determination can include assigning a binary motion base saliency score to an input pixel or assigning a non-binary motion base saliency score of a pixel in response to the amount of motion; (iii) stage 114 of determining an importance of an input pixel in response to a saliency score of the input pixels; (iv) stage 115 of determining an importance of an input pixel in response to an inclusion of an input pixel within a an input image that represents a face of a person.

Stage 110 is followed by stage 120 of applying on each of the multiple input pixels a conversion process that is responsive to the interest value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.

Stage 120 can be preceded by stage 119 of performing a data reduction stage. The performing can include representing each set of pixels by a single variable, ignoring pixel importance information, and the like. FIG. 1 illustrates stage 119 as being included in stage 110.

FIG. 4 illustrates various stages that can be included in stage 120. It is noted that some of the stages are overlapping. Conveniently, stage 120 can include at least one of the following stages or a combination thereof: (i) stage 121 of determining a distance between output image representations of a pair of adjacent input pixels is responsive to an importance of at least one of pair of adjacent input pixels. The distance can range from one or more pixels to a portion of a pixel; (ii) stage 122 of at least partially compensating for camera induced motion; (iii) stage 123 of applying an optimal mapping between the input image to the output image; (iv) stage 124 of solving a set of sparse linear equations; (v) stage 125 of applying a conversion process that is responsive to at least one of the following constraints: each input pixel is mapped to an output pixel that is located at substantially a fixed distance from its left and right neighbors; each input pixel is mapped to an output pixel located to substantially a similar location to which upper and lower input pixels are mapped; an input pixel is mapped to an output pixel located substantially at a same location as an output pixel to which the same input pixel at a previous image was mapped; and size and shape of the output image; (vi) stage 126 of re-sizing; (v) stage 127 of altering an aspect ratio.

Conveniently, the input image belongs to an input image sequence and wherein the applying is responsive to a relationship between the input image and at least one other input of the input image sequence.

FIG. 5 illustrates method 300 according to an embodiment of the invention.

Method 300 differs from method 100 by the processing of a group of input images.

Method 300 starts by stage 310 of determining an interest value for each input pixels out of multiple input pixels of the group of input images. These multiple input images can form a shot or a portion of a shot.

Stage 310 can resemble stage 110 but it is applied on pixels of a group of images. It can be applied on these pixels simultaneously.

Stage 310 can include stages that are analogue to stages 111-115 and 119. For example, stage 310 can include applying a data reduction stage to provide results of a data reduction stage. It this case stage 320 will include applying on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.

Stage 310 is followed by stage 320 of applying on each of the multiple input pixels of the group of images a conversion process that is responsive to the interest value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image. The conversion process of a certain image can be responsive to one or more frames that precede this certain image and to one or more mages that follow this certain image.

Stage 320 can include stages that are analogue to stages 121-127. It can also include stage 328 of applying the conversion process on elements of a combined saliency matrix, wherein the combined saliency matrix includes multiple saliency matrices, each representative of a saliency of multiple pixels of a single input image out of the group of input images.

Stages 310 and 320 can be executed in a manner that generates a panning effect. Assuming that a sequence of K images (IA(1) . . . IA(K)) form a shot, that the panning effect includes a movement of the camera from left to right, and that portions of size P×Q pixels should be regarded as the input image. In this case the first input image will include the leftmost P*Q pixels of IA(1), the second input image will include a slightly shifted portion of P×Q pixels of IA(2) and the K'th input image should include the rightmost P*Q pixels of IA(K). The pixels that belong to these input images can be processed by applying stages 310 and 320 to provide a panning effect.

Sample Images

FIG. 12 a is an original image. FIG. 12 b is a half width retargeted output image generated by applying method 100. FIG. 12 c is a half width retargeted output image generated by applying a prior art method. FIG. 12 d illustrates an original image (leftmost image) that undergoes saliency processing, face detection and motion detection, an optimization process (conversion process) and an output frame.

FIG. 13 a is an input image while FIG. 13 b is a retargeted frame (half width) generated by applying the method 100. It is noted that a cropped window cannot achieve the same frame area utilization.

FIG. 14 a is an input frame, FIG. 14 b is a gradient map of the input frame with the faces detected imposed, FIG. 14 c is a result of a retargeting to half the width without face detection and FIG. 14 d is a result of retargeting with face detection.

FIG. 15 a is an input image taken from the MPEG/ITU-T committee bench-mark video “football”. FIG. 15 b is a saliency map that includes the motion. FIG. 15 c is a result of bi-cubic interpolation to half the width. FIG. 15 d is an output image generated by retargeting without motion based saliency and FIG. 15 e is the result of retargeting with the full saliency map.

The top row of FIGS. 16 a-16 c depicts the retargeting results of a certain frame while the top row of FIGS. 16 a-16 c depicts the retargeting results of another image. FIG. 16 a illustrates a result of a bi-cubic interpolation, FIG. 16 b illustrates the result of frame by frame retargeting and FIG. 16 c illustrates a time smoothed retargeting. Time smoothing prevents the video from “jumping around”.

Each of FIG. 17 a-17 c illustrates an original frame (bottom of each figure), a result of a bi-cubic interpolation (top-right) and a result of applying the method 100 (top-left). The latter retargeting method prevents much of the thinning effect caused by the rescaling and preserves details.

Each of FIG. 18 a-18 c illustrates a result of a bi-cubic interpolation (bottom) and a result of applying the method 100 (top). The latter retargeting method applies a non-homogenous zooms to the objects of interest.

FIG. 19 a illustrates an input frame while FIG. 19 b is a two fold wider retargeted output image generated by applying the method 100.

APPENDIX A

APPENDIX A illustrates a method and system for providing an output image. Especially, a method and device for inhomogeneous 2D texture mapping guided by a feature mask is provided. The mapping can apply one or more conversion processes that are responsive to the feature mask. The mapping preserves some regions of the image, such as foreground objects or other prominent parts. The method is also referred to as the method illustrated in appendix A. This method includes receiving an input frame and a feature mask defined by a rough selection of the features interest map and mapping them (by solving a sparse equation set) to an output frame. If a rigid transformation (rigid mapping) is applied then the featured indicated in the feature mask can undergo (during the mapping) a similarity transformation, possibly at the expense of the background regions in the texture that are allowed to deform more. If a similarity transformation (similarity mapping) is applied then the size of a feature can be slightly changed.

Appendix A illustrates a method for providing an output image, the method includes: receiving an input frame and a feature mask defined by a rough selection of the features; applying a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.

Conveniently, the mapping process applies a similarity transformation on pixels of features included in the feature mask.

Conveniently, the mapping process allows pixels of features included in the feature mask to slightly change.

Appendix A illustrates a device for providing an output image, the device includes: a memory unit adapted to store an input image and a feature mask defined by a rough selection of the features; and a processor, adapted to: apply a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.

Conveniently, the processor applies a similarity transformation on pixels of features included in the feature mask.

Conveniently, the processor applies allows pixels of features included in the feature mask to slightly change.

Appendix A illustrates a computer readable medium that stores instructions for: receiving an input frame and a feature mask defined by a rough selection of the features; applying a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.

Conveniently, the computer readable medium stores instructions for applying a similarity transformation on pixels of features included in the feature mask.

Conveniently, the computer readable medium stores instructions for allowing pixels of features included in the feature mask to slightly change.

Instead of cropping the frames, the device and method shrink them while respecting the salient regions and maintaining the user experience. The proposed device and method are efficient and the optimization stage includes of solving a sparse N×N system, where N is the number of pixels in each frame. The method and device are well adapted to batch applications, but are designed for streaming video since they compute the warp of a given frame based on a smalltime-neighborhood only, and are is fast enough to avoid delays. It is noted that the method and system can also perform up-scaling.

The method and device can be applied to solve several retargeting tasks:

video down/up-sampling, aspect ratio alterations, and non-homogenous video expansion, video abstraction, object removal from a video, and object insertion to video while respecting the saliency. It is noted that object removal is done by zeroing the saliency measure of the object while object insertion is implemented by placing a new blob of pixels in between existing image pixels and setting it the importance of the new pixels to a large value.

The method of appendix A does not distort the regions of interest.

The method of appendix A and the system are able to arbitrarily warp a given image while preserving the shape of its features by constraining their deformation to be a similarity transformation.

In particular, the method and system allow global or local changes to the aspect ratio of the texture without causing undesirable shearing to the features. The algorithmic core of the method and system is a particular formulation of the Laplacian editing technique, suited to accommodate similarity constraints on parts of the domain.

The method illustrated in appendix A is useful in digital imaging, texture design and any other applications involving image warping, where parts of the image have high familiarity and should retain their shape after modification.

In 2D texture mapping applications, images are mapped onto arbitrary 2D shapes to create various special effects; the texture mapping is essentially a warp of the texture image, with constraints on the shape of the boundary or possibly the interior of the image as well. Such texture mapping is common in graphical design and publishing tools, as well as 2D and 3D modeling and animation applications. Commercial design tools usually provide a library of predefined warps, where the user only needs to select the desired mapping type and possibly tune a few parameters. Another option is to interactively design the texture map by selecting and transforming points or curves on the original image; the mapping is computed so as to accommodate such user constraints. It is also possible to apply free-form deformations with grid-based controls.

Texture manipulation in 2D is commonly applied by modelers when texturing 3D models: the texture map often needs to be adjusted and aligned to match particular features of the 3D surface. Constrained texture mapping methods have been developed for this purpose where the user supplies point correspondences between the texture and the 3D model, and a suitable mapping is computed automatically.

Most image mapping and manipulation techniques treat the entire texture image homogeneously. When the deformation applied to an image introduces shearing, e.g. in the simplest situation where the aspect ratio of an image is altered by non-uniform scaling, all the image features are distorted. This may be disturbing when the image contains features with highly familiar shape, such as humans, animals, prominent geometric objects, etc. A typical example of a simple image transformation is shown in FIG. 12 a, where the shear and stretch effects distort the images of the children in a quite unsatisfactory manner.

The method illustrated in appendix A is capable of preserving the shape of masked regions of the texture while warping the image according to the user specifications. This feature-aware texture mapping is guided by a feature mask defined by a rough selection of the features; in the mapping result, these features will undergo solely a similarity transformation, possibly at the expense of the background regions in the texture that are allowed to deform more. This method can relate to the texture optimization techniques of Balmelli et al., where the texture map is warped to allow higher pixel budget for the high-frequency details of the texture image.

At a first glance, it seems that a feature-preserving mapping could be achieved by cutting out the features, warping the rest of the image as desired and then pasting the features back and adjusting their orientation and scale. However, this poses several difficulties: (i) precise segmentation of the features with correct alpha-mattes for subsequent seamless compositing is required; (ii) it is not clear how to prescribe the similarity transformation of the features; (iii) texture synthesis heeds to be applied for the holes that are likely to form around the features; alternatively, the pasted features could overlap with parts of the warped texture, causing information loss. The above tasks are quite complex; moreover, the tuning of such an algorithm would require significant amount of user interaction. In contrast, our method does not require a highly accurate matte but rather a loose selection of the features, which can be done using standard selection tools. The method illustrated in appendix A produces coherent, smooth image warps by drawing upon the recent machinery of differential representations and deformation techniques.

Feature-Aware Mapping

The suggested feature-preserving texture mapping technique is first described assuming that an input warping function W: R²→R² is given. Assume that the input image is represented by a regular pixel grid of dimensions m×n. The grid of the input image is denoted by G=(V,E,K), where V={v₁, v₂, . . . , v_(N)} is the set of node positions (N=mn), E={(i, j)} is the set of directed edges between the nodes and K is the set of quad faces of the grid. Throughout the discussion it is assumed that G is a 4-connected quad grid, although the algorithm can be easily extended to any general meshing of the image. It is assumed that the values of the input mapping W on all the grid nodes v_(i) are known.

The user provides a feature mask that marks the parts of the image whose shape should be preserved. The mask is denoted by M={m₁, . . . , m_(N)}, such that m_(i)=1 if pixel i belongs to a feature and m_(i)=0 otherwise. The feature nodes indices are thus F={i s.t. m_(i)=1}. The method 100 partitions F into its connected components: F=F₁∪F₂∪ . . . ∪F_(d) (see FIG. 2( e)). The method of appendix A aims to find a mapping of the original grid G that is as close as possible to the input warp W and respects the shape of the features specified by the mask M. It is desired to preserve the shape of all the quads contained in the features, meaning that they should undergo solely a similarity or rigid transformation. Rigid transformation implies that the size of the features will be preserved, whereas a similarity transformation allows varying the size according to the warping function W. The user can be left with the choice between rigid and similarity behavior.

A proper shape preserving transformation for each quad Q=(v_(i) ₁ ,v_(i) ₂ ,v_(i) ₃ ,v_(i) ₄ ) that has at least one node in F is provided. W(Q) is approximated with a rotation/similarity transformation, by taking the linear component of W and extracting the rotation from it by means of the polar decomposition.

Specifically, denote W(Q)=(v_(i) ₁ ′,v_(i) ₂ ′,v_(i) ₃ ′,v_(i) ₄ ′); denote by

$v = {\frac{1}{4}{\sum\limits_{k = 1}^{4}\; v_{i_{k}}}}$

the centroid of Q; the centered vertices are then u_(i) _(k) =v_(i) _(k) −v (and similarly, u_(i) _(k) ′ or W(Q)). The method can linearly approximate the homogeneous part of W on Q by:

T _(W,Q) =[u _(i) ₁ ′u _(i) ₂ ′u _(i) ₃ ′u _(i) ₄ ′]·[u _(i) ₁ u _(i) ₂ u _(i) ₃ u _(i) ₄ ]*,  (10)

where A* denotes the pseudoinverse of matrix A. In fact, T_(W,Q) is an approximation of the Jacobian of W on Q; if given the analytical expression of W, T_(W,Q) can be replaced by the Jacobian of W at, say, v_(i) ₁ .

To extract the rigid component of T_(W,Q) the method performs its singular value decomposition: T_(W,Q)=UΣV^(T); the rigid component of T_(W,Q) is then

R_(W,Q)=VU^(T).  (11)

To devise the feature-preserving mapping, the method formulates the following optimization problem: it would be desired that all the elements outside of F to undergo a transformation as close as possible to W, and all the elements in F should undergo solely the rigid (or similarity) component of W. It is convenient to formulate the requirements of this optimization per quad. If quad Q=(v_(i) ₁ ,v_(i) ₂ ,v_(i) ₃ ,v_(i) ₄ ) belongs to a feature (i.e. it has at least one node in F), the method defines the following four equations related to its four edges:

{tilde over (v)} _(i) _(k+1) −{tilde over (v)} _(i) _(k) =R _(W,Q)(v _(i) _(k+1) )−R _(W,Q)(v _(i) _(k) ), k=1, . . . , 4 cyclically  (12)

where {tilde over (v)}_(i) _(k) are the unknown deformed grid nodes. Similarly, if Q does not belong to a feature, we add the following four equations for its edges:

{tilde over (v)} _(i) _(k+1) −{tilde over (v)} _(i) _(k) =W(v _(i) _(k+1) )−W(v _(i) _(k) ), k=1, . . . , 4 cyclically  (13)

Overall, the method of appendix A obtains an over-determined system of 4|K| equations in 2N unknowns, which can be solved in the least squares sense. Note that the system is separable in the two coordinates, thus we can solve for x and y separately, with the system matrix containing N columns. The method can constrain the boundary nodes to their positions under W to make the optimization problem well-posed:

{tilde over (v)} _(i) =W(v _(i)), ∇iε∂G.  (14)

Solving for {tilde over (v)}₁, . . . , {tilde over (v)}_(N) will provide a mapping that rigidly preserves the features, including their size. To obtain a shape-preserving mapping that allows appropriate scaling of the features, the method can modify the local transformations R_(W,Q) as follows.

The method estimates that the average scaling of each connected feature component F_(i) under W by observing the singular values of the transformations T_(W,Q). For each element QεF_(i), the method takes the smaller singular value of T_(W,Q), and average those values over all QεF_(i), obtaining the average scale factor λ_(i). Conveniently, the smaller singular values are averaged, because intuitively, if the image is stretched in one direction, the feature size should remain constant. The target local transformations of the quads in each F_(i) are thus updated to be λ_(i)R_(W,Q), and Eq. ((2)) is modified accordingly.

Smoothing the Mapping

When the input warp W is largely deforming the geometry of G, feature shape preservation may be compromised. To compensate for such situations, it is useful to apply weights to Eq. ((2)) that is responsible for feature preservation: each side of those equations is multiplied by weight w, (a sample value of w_(F)=10). Since a least-squares system of equations is solved, this multiplication results in w_(F) ²-magnification of the corresponding error terms in the minimization functional, forcing the optimization to respect the features more, at the expense of larger deformation of other areas.

However, since the weights are abruptly discontinuous at the feature boundaries (weighting of 1 outside the feature and w_(f) ?1 inside), such solution damages the smoothness of the mapping near the feature boundary. This can be easily corrected by assigning a more smooth weighting function: computing a local distance field to the feature and assigning smoothly decreasing weights for the quads in the vicinity of the feature as functions of the distance field. The equations associated with those “transition-quads” are of type ((2)).

The following polynomial can be used as the decay function:

${{f(x)} = {{\frac{2}{\rho^{3}}x^{3}} - {\frac{3}{\rho^{2}}x^{2}} + 1}},$

(15) where the constant ρ>0 controls the extent of the decay; the weights in the intermediate region around the feature boundaries are thus defined as:

w(Q)=w _(F) ·f(D(Q))+1·(1−f(D(Q))),  (16)

where D(Q) is the value of the distance to the feature at the center of Q. The decay radius p is set to be the width of two grid cells; outside of this radius the weights are set to 1.

Interactive Texture Mapping

Two possible modes of texturing application are differentiated from each other: input-warp mode (described in the previous section) and interactive mode. In both modes, the feature regions of the input image are first specified by a feature mask. In the interactive mode, the user designs the mapping using the standard controls of image boundary editing and/or prescription of inner curve transformations. The mapping is computed taking into account these user-defined constraints and the feature mask, using a deformation technique based on differential coordinates.

These user's manipulations are interpreted by the system as positional constraints on the grid nodes, i.e. simply

{tilde over (v)}_(i)=c_(i), iεU,  (17)

where U is the set of the nodes constrained by the user and c_(i) are the new positions for those nodes.

The mapping of the free grid nodes is decided by applying the Laplacian editing optimization. The goal of this optimization is to create a smooth and as-rigid-as-possible mapping of the grid shape that respects the user constraints ((17)).

“As-rigid-as-possible” means that if the user-constraints imply solely a rigid (or similarity) transformation of the grid shape, the optimization technique indeed delivers such transformation; otherwise, the optimization finds a mapping that is locally as close as possible to being rigid, which is perceived as an intuitive result. The optimization involves solving a sparse linear system of size 2N×2N.

Once the mapping function W is established in the above manner, its feature-preserving approximation is created according to the feature mask, as described in Section “Feature-aware mapping” above.

Sample Implementation Details

Size setup Factor Rhs setup Solve  50 × 100 0.156 0.110 0.015 0 100 × 100 0.375 0.250 0.031 0.015 100 × 200 1.141 0.562 0.047 0.031 200 × 200 2.171 1.407 0.109 0.063

Table 1 illustrates timing statistics (in seconds) for the different parts of the mapping algorithm. Sys. setup stands for the setup of the normal equations matrix; Rhs setup denotes the building the right-hand side of the normal equations and Solve stands for the back-substitution. Note that the system setup and matrix factorization is done in a pre-process, once per given image grid.

The algorithmic core of the feature-sensitive texture mapping is the solution of the least-squares optimization expressed by Eqs. ((2)-(3)) and ((14)).

When put together, these equations form an over-determined linear system of the form:

A(xy)=(b _(x) b _(y)),  (18)

where x=({tilde over (x)}₁, . . . , {tilde over (x)}_(N))^(T) are the x coordinates of the deformed grid and y=({tilde over (y)}₁, . . . , {tilde over (y)}_(N))^(T) are the y coordinates.

The system is separable in the two coordinates, so the system matrix A has N columns. The matrix is very sparse since there are only two non-zero coefficients in each row. The system is solved by factoring the normal equations:

A ^(T) A(xy)=A ^(T)(b _(x) b _(y)).  (19)

The Taucs library is used for efficient sparse matrix solvers. Cholesky factorization provides a sparse lower-triangular matrix L such that

A^(T)A=LL^(T).  (20)

Then, the equations can solved by double back substitution:

Lx_(temp)=A^(T)b_(x)  (21)

L^(T)x=x_(temp),

and in the same fashion for the y component. Thus, a single factorization serves solving for multiple right-hand sides.

The construction of the A matrix, the normal equations matrix and the factorization can be attributed to the pre-process, since they only depend on the grid and the feature map of the input image; the matrix factorization is the most computationally-intensive part, taking a few seconds for grids with several tens of thousands of quads. Once the factorization is computed, back substitution is extremely fast (see Table 1).

When varying the input warp function W, there is only need to update the right-hand side of the system (the b_(x),b_(y) vectors) and perform back-substitution, so the user can experiment with various mappings in real time. Of course, manipulation of very large images may slow down due to the large dimensions of the system matrix; to maintain interactive response in this case the grid is defined to be slightly coarser than the pixel grid of the input image, so that the size of the system remains in the order of 20000-50000 variables. For example, it can efficiently handle an image of 1000×1000 pixels by defining the size of the grid cells to be 5×5 pixels.

Computing the initial mapping by interactively-placed user constrains (Section “Interactive texture mapping”) also requires solving a sparse linear system of size 2N×2N. It is done in the same manner: pre-factoring the system matrix and solely varying the right-hand side of the system when the user manipulates the boundary constraints. Since the back-substitution is fast, the manipulation is interactive, as demonstrated in the accompanying video.

The mentioned above feature-sensitive texturing system on a Pentium 4 3.2 GHz computer with 2 GB RAM. It was assumed that the feature mask comes together with the input image, defined in some external image editing software. During the experiments the feature maps were created by Photoshop using the standard selection tools (Magic Wand, Lasso and Magnetic Lasso). The process of feature selection is quite easy since the feature-aware texturing needs only a rough binary matte.

The inventor experimented with various input warping functions that are commonly available in most image editing packages. The results of unconstrained mapping with the mentioned above feature-preserving mapping were compared in various figures. It can be clearly seen in all the examples that the mentioned above mapping preserves the shape of the features while gracefully mimicking the input mapping function. The similarity-preserving mapping allows uniform scaling of the features, and thus it has more freedom to approximate the input mapping. For instance, when the input mapping implies enlargement of the image, the similarity-preserving mapping will allow uniform scaling of the features, whereas the rigid mapping will constrain the features to remain in their original size, thus introducing more stretch to the background areas.

In extreme deformation cases, the feature-aware mapping may introduce fold-overs, which may result in texture discontinuity. Preventing self-intersections within the least-squares optimization is quite difficult; it is noted that the method can be adapted to perform post-processing relaxations to fix the fold-overs.

Sample Images

FIGS. 6 a-6 b, 7 a-7 h, 8 a-8 c, 9 a-9 d, 10 a-10 f, 11 a-11 j illustrate the differences between applying prior art mapping method and applying the method illustrated in appendix A.

FIG. 6 a is the result of applying a prior art mapping process on an image while FIG. 6 b is a result of applying the method of appendix A. It is noted that in FIG. 6 a the legs of the children are squeezed and their heads are stretched. This affects do not appear in FIG. 6 b.

FIG. 7 a is an original image. FIGS. 7 b, 7 c and 7 d are the result of applying a prior art mapping process on an image so as to map the image onto a vertically stretched output frame, onto an arc shaped output frame and onto a sinusoidal output frame. FIG. 7 e illustrates a feature map (of features F1-F11) that is generated by applying the method illustrated in appendix A. FIGS. 7 f, 7 g and 7 h are the result of applying the method illustrated in appendix A so as to map an image onto a vertically stretched output frame, onto an arc shaped output frame and onto a sinusoidal output frame.

FIG. 8 a is an original image. FIG. 8 b illustrates a result of applying the method illustrated in appendix A so as to map an image onto vertically (×2) stretched output frame. FIG. 8 c illustrates an underlying grid.

FIG. 9 a is an original image. FIG. 9 b is the result of applying a prior art mapping process on an image so as to map the image onto a swirl feature the method illustrated in appendix A method according to an embodiment of the invention so as to map the image onto a swirl feature output frame while constraining the size of features. FIG. 9 d illustrates a result of applying the method illustrated in appendix A so as to map the image onto a swirl feature output frame while allowing uniform scaling of the features.

FIG. 10 a is an original image. FIG. 10 b is the result of applying a prior art mapping process on an image so as to map the image onto three dimensional shape. FIG. 10 c illustrates the result of applying the method illustrated in appendix A on an image so as to map the image onto three dimensional shape.

FIG. 10 d is an original image. FIG. 10 e is the result of applying a prior art mapping process on an image so as to map the image onto another three dimensional shape. FIG. 10 f illustrates the result of applying the method illustrated in appendix A on an image so as to map the image onto another three dimensional shape.

FIG. 11 a is an original image. FIG. 11 b is the result of applying a prior art mapping process on an image so as to map the image onto a swirl feature output frame. FIG. 11 c illustrates a result of applying the method illustrated in appendix A so as to map the image onto a swirl feature output frame while constraining the size of features. FIG. 11 d illustrates a result of applying the method illustrated in appendix A so as to map the image onto a swirl feature output frame while allowing uniform scaling of the features.

FIG. 11 e is an original image. FIG. 11 f is the result of applying a prior art mapping process on an image so as to map the image onto an arc shaped output frame. FIG. 11 g illustrates a result of applying the method illustrated in appendix A so as to map the image onto an arc shaped output frame while constraining the size of features. FIG. 11 h illustrates a result of applying the method illustrated in appendix A so as to map the image onto an arc shaped output frame while allowing uniform scaling of the features.

FIG. 11 i is an original image. FIG. 11 j is the result of applying a prior art mapping process on an image so as to map the image onto a circular shaped output frame. FIG. 11 k illustrates a result of applying the method illustrated in appendix A so as to map the image onto a circular shaped output frame while constraining the size of features. FIG. 11 l illustrates a result of applying the method illustrated in appendix A so as to map the image onto a circular shaped output frame while allowing uniform scaling of the features.

Variations, modifications, and other implementations of what is described herein will occur to those of ordinary skill in the art without departing from the spirit and the scope of the invention as claimed. Accordingly, the invention is to be defined not by the preceding illustrative description but instead by the spirit and scope of the following claims. 

1. A method for providing an output image, the method comprising: determining an importance value for each input pixels out of multiple input pixels of an input image; applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.
 2. The method according to claim 1 wherein the determining comprises determining an importance input pixel mask.
 3. The method according to claim 1 wherein the determining is responsive to motion associated with each of the multiple input pixels.
 4. The method according to claim 3 wherein the determining is responsive to a saliency score of the input pixels.
 5. The method according to claim 3 wherein the determining is responsive to an inclusion of an input pixel within an input image area that represents a face of a person.
 6. The method according to claim 3 wherein the determining is responsive to an inclusion of an input pixel within an input image area that represents an object of interest.
 7. The method according to claim 1 wherein a distance between output image representations of a pair of adjacent input pixels is responsive to an importance of at least one of pair of adjacent input pixels.
 8. The method according to claim 1 further comprising compensating for camera induced motion.
 9. The method according to claim 1 wherein the applying comprises applying an optimal mapping between the input image to the output image.
 10. The method according to claim 9 wherein the applying comprises solving a set of sparse linear equations.
 11. The method according to claim 1 wherein the applying is responsive to at least one of the following constraints: each input pixel is mapped to an output pixel that is located at substantially a fixed distance from its left and right neighbors; each input pixel is mapped to an output pixel located to substantially a similar location to which upper and lower input pixels are mapped; an input pixel is mapped to an output pixel located substantially at a same location as an output pixel to which the same input pixel at a previous image was mapped; and size and shape of the output image.
 12. The method according to claim 1 wherein the applying comprises re-sizing.
 13. The method according to claim 1 wherein the applying comprises altering an aspect ratio.
 14. The method according to claim 1 wherein the input image belongs to an input image sequence and wherein the applying is responsive to a relationship between the input image and at least one other input of the input image sequence.
 15. The method according to claim 1 wherein the determining is responsive to a saliency score of the input pixels; wherein the saliency score is computed by applying a wavelet decomposition process.
 16. The method according to claim 1 wherein the determining is responsive to a saliency score of the input pixels; wherein the saliency score is computed by locating the coarsest diagonal high frequency frame in which the percentage of wavelet coefficients having values below a first threshold is below a second threshold.
 17. The method according to claim 1 wherein the determining is responsive to a saliency score of the input pixels; wherein the saliency score is computed by applying a wavelet decomposition process; wherein the wavelet decomposition process is followed by thresholding a diagonal high frequency image to generate a binary frame; re-scaling the binary frame; and smoothing the re-scaled binary frame.
 18. The method according to claim 1 wherein the applying is preceded by applying a data reduction stage; and applying on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.
 19. The method according to claim 1 comprising generating motion based saliency of a pixel in response to the amount of motion.
 20. The method according to claim 1 comprising: determining an importance value for each input pixels out of multiple input pixels of a group of input images; and applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form group of output images; wherein inputs image differs from output images.
 21. The method according to claim 20 comprising: generating a combined saliency matrix that includes multiple saliency matrices, each representative of a saliency of multiple pixels of an input image; and applying the conversion process on elements of the combined saliency matrix.
 22. The method according to claim 20 comprising: applying a data reduction stage; and applying on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.
 23. The method according to claim 20 comprising generating a panning effect.
 24. A device for providing an output image, the device comprising: a memory unit adapted to store an input image and a processor, adapted to: determine an importance value for each input pixels out of multiple input pixels of an input image and apply on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.
 25. The device according to claim 24 wherein the processor is adapted to determine an importance input pixel mask.
 26. The device according to claim 24 wherein the processor is adapted to determine an importance of an input pixel in response to motion associated with each of the multiple input pixels.
 27. The device according to claim 26 wherein the processor is adapted to determine an importance of an input pixel in response to a saliency score of the input pixels.
 28. The device according to claim 26 wherein the processor is adapted to determine an importance of an input pixel in response to an inclusion of an input pixel within an input image that represents a face of a person.
 29. The device according to claim 26 wherein the processor is adapted to determine an importance of an input pixel in response to an inclusion of an input pixel within an input image that represents an object of interest.
 30. The device according to claim 26 wherein the processor is adapted to determine a distance between output image representations of a pair of adjacent input pixels in response to an importance of at least one of pair of adjacent input pixels.
 31. The device according to claim 24 wherein the processor is adapted to compensate for camera induced motion.
 32. The device according to claim 24 wherein the processor is adapted to perform an optimal mapping between the input image to the output image.
 33. The device according to claim 32 wherein the processor is adapted to solve a set of sparse linear equations.
 34. The device according to claim 24 wherein the processor is adapted to apply a conversion process in response to at least one of the following constraints: each input pixel is mapped to an output pixel that is located at substantially a fixed distance from its left and right neighbors; each input pixel is mapped to an output pixel located to substantially a similar location to which upper and lower input pixels are mapped; an input pixel is mapped to an output pixel located substantially at a same location as an output pixel to which the same input pixel at a previous image was mapped; and size and shape of the output image.
 35. The device according to claim 24 wherein the processor is adapted to apply re-sizing.
 36. The device according to claim 24 wherein the processor is adapted to alter an aspect ratio.
 37. The device according to claim 24 wherein the input image belongs to an input image sequence and wherein the processor is adapted to apply a conversion process in response to a relationship between the input image and at least one other input of the input image sequence.
 38. The device according to claim 24 wherein the processor is adapted to determine in response to a saliency score of the input pixels; wherein the saliency score is computed by applying a wavelet decomposition process.
 39. The device according to claim 24 wherein the processor is adapted to determine in response to a saliency score of the input pixels; wherein the saliency score is computed by locating the coarsest diagonal high frequency frame in which the percentage of wavelet coefficients having values below a first threshold is below a second threshold.
 40. The device according to claim 24 wherein the processor is adapted to determine in response to a saliency score of the input pixels; wherein the saliency score is computed by applying a wavelet decomposition process; wherein the wavelet decomposition process is followed by thresholding a high frequency image to generate a binary frame; re-scaling the binary frame and smoothing the re-scaled binary frame.
 41. The device according to claim 24 wherein the processor is adapted to apply a data reduction stage; and applying on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.
 42. The device according to claim 24 wherein the processor is adapted to determine in response to generate motion based saliency of a pixel in response to the amount of motion.
 43. The device according to claim 24 wherein the processor is adapted to: determine in response to an importance value for each input pixels out of multiple input pixels of a group of input images; and apply on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form group of output images; wherein inputs image differs from output images.
 44. The device according to claim 43 wherein the processor is adapted to generate a combined saliency matrix that includes multiple saliency matrices, each representative of a saliency of multiple pixels of an input image; and applying the conversion process on elements of the combined saliency matrix.
 45. The device according to claim 43 wherein the processor is adapted to apply a data reduction stage; and apply on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.
 46. The device according to claim 43 wherein the processor is adapted to generate a panning effect.
 47. A computer readable medium that stores instructions for: determining an importance value for each input pixels out of multiple input pixels of an input image; and applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form the output image; wherein the input image differs from the output image.
 48. The computer readable medium of claim 47 that stores instructions for determining an importance input pixel mask.
 49. The computer readable medium of claim 47 that stores instructions for determining an importance value in response to motion associated with each of the multiple input pixels.
 50. The computer readable medium of claim 47 that stores instructions for determining an importance value in response to a saliency score of the input pixels.
 51. The computer readable medium of claim 50 that stores instructions for determining an importance value in response to an inclusion of an input pixel within an input image that represents a face of a person.
 52. The computer readable medium of claim 50 that stores instructions for determining an importance value in response to an inclusion of an input pixel within an input image that represents an object of interest.
 53. The computer readable medium of claim 50 that stores instructions for determining an importance value in response to applying a conversion process such that a distance between output image representations of a pair of adjacent input pixels is responsive to an importance of at least one of pair of adjacent input pixels.
 54. The computer readable medium of claim 47 that stores instructions for determining is responsive to a saliency score of the input pixels; wherein the saliency score is computed by applying a wavelet decomposition process.
 55. The computer readable medium of claim 47 that stores instructions for determining is responsive to a saliency score of the input pixels; wherein the saliency score is computed by locating the coarsest high frequency frame in which the percentage of wavelet coefficients having values below a first threshold is below a second threshold.
 56. The computer readable medium of claim 47 that stores instructions for determining is responsive to a saliency score of the input pixels; wherein the saliency score is computed by applying a wavelet decomposition process; wherein the wavelet decompression process is followed by thresholding a high frequency image to generate a binary frame; re-scaling the binary frame and smoothing the re-scaled binary frame.
 57. The computer readable medium of claim 56 that stores instructions for applying a data reduction stage; and applying on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.
 58. The computer readable medium of claim 47 that stores instructions for generating motion based saliency of a pixel in response to the amount of motion.
 59. The computer readable medium of claim 47 that stores instructions for: determining an importance value for each input pixels out of multiple input pixels of a group of input images; and applying on each of the multiple input pixels a conversion process that is responsive to the importance value of the input pixel to provide multiple output pixels that form group of output images; wherein inputs image differs from output images.
 60. The computer readable medium of claim 59 that stores instructions for generating a combined saliency matrix that includes multiple saliency matrices, each representative of a saliency of multiple pixels of an input image; and applying the conversion process on elements of the combined saliency matrix.
 61. The computer readable medium of claim 59 that stores instructions for applying a data reduction stage; and applying on each of the results of the data reduction stage a conversion process that is responsive to the importance value of the results to provide converted results.
 62. The computer readable medium of claim 59 that stores instructions for generating a panning effect.
 63. A method for providing an output image, the method comprising: receiving an input frame and a feature mask defined by a rough selection of the features; applying a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.
 64. The method according to claim 63 wherein the mapping process applies a similarity transformation on pixels of features included in the feature mask.
 65. The method according to claim 63 wherein the mapping process allows pixels of features included in the feature mask to slightly change.
 66. A device for providing an output image, the device comprising: a memory unit adapted to store an input image and a feature mask defined by a rough selection of the features; a processor, adapted to: apply a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.
 67. The device according to claim 66 wherein the processor applies a similarity transformation on pixels of features included in the feature mask.
 68. The device according to claim 66 wherein the processor applies allows pixels of features included in the feature mask to slightly change.
 69. A computer readable medium that stores instructions for: receiving an input frame and a feature mask defined by a rough selection of the features; applying a mapping process to provide the output image; wherein the mapping process differentiates between pixels of features included in the feature mask and between other pixels; wherein the applying comprises solving a sparse equation set.
 70. The computer readable medium of claim 69 that stores instructions for applying a similarity transformation on pixels of features included in the feature mask.
 71. The computer readable medium of claim 69 that stores instructions for allowing pixels of features included in the feature mask to slightly change. 